// write your code here
import java.util.Scanner;

public class Main{
    
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            String str1 = sc.next();  //这里使用next
            String str2 = sc.next();
            int count = 0;
            while(str1.contains(str2)){
                count++;
                str1 = str1.replaceFirst(str2,""); //将str1中的str2设置为""
            }
            System.out.println(count);
        }
        sc.close();
    }
    
    
}